package cn.hnu.sougou

import com.hankcs.hanlp.HanLP
import com.hankcs.hanlp.seg.common.Term

import java.util
import scala.collection.mutable
import scala.collection.JavaConverters._

object Test01 {
  def main(args: Array[String]): Unit = {
    val wordsStr="[中共中央政治局召开会议分析研究2025年经济工作研究部署]"
    //先去掉[ ]
    val newWordsStr: String = wordsStr.replace("\\[|\\]", "")

    val terms: util.List[Term] = HanLP.segment(newWordsStr)
    val result0: mutable.Buffer[Term] = terms.asScala
    println(result0)

    val result1: mutable.Buffer[String] = terms.asScala.map(_.word)
    println(result1)
  }
}


